PHP: usort

您所在的位置:网站首页 sort of like this PHP: usort

PHP: usort

#PHP: usort| 来源: 网络整理| 查看: 265

Example #5 usort() example using the spaceship operator

The spaceship operator allows for straightforward comparison of compound values across multiple axes. The following example will sort $people by last name, then by first name if the last name matches.

The above example will output:

Baldwin, Adam Baldwin, Alec West, Adam


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3